<!-- application/layouts/scripts/layout.phtml -->

<?php
$front = Zend_Controller_Front::getInstance();
$auth = Zend_Auth::getInstance();
?>

<?php echo $this->doctype() ?>
<html>
    <head>
        <meta charset="utf-8">
        <title>Personal Task</title>
        <meta name="description" content="Gestor de tareas personales">
        <meta name="author" content="Eduardo Pool">
        <!�[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]�>
        <link type="text/css" href="<?= $front->getBaseUrl() . '/css/smoothness/jquery-ui-1.8.20.custom.css' ?>" rel="stylesheet" />
        
        <style>
            body { padding-top: 60px; }
        </style>
        <?php
        echo $this->headLink()->appendStylesheet($front->getBaseUrl() . '/bootstrap/css/bootstrap.min.css')
                    ->appendStylesheet($front->getBaseUrl() . '/bootstrap/css/bootstrap-responsive.min.css');
        ?>
        <script type="text/javascript" src="<?= $front->getBaseUrl() . '/js/jquery-1.7.2.js' ?>"></script>
        <script type="text/javascript" src="<?= $front->getBaseUrl() . '/js/jquery-ui-1.8.18.custom.min.js' ?>"></script>
        <script type="text/javascript" src="<?= $front->getBaseUrl() . '/js/activitySearchAutocomplete.js' ?>"></script>
    </head>
    <body>

        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href=<?= $this->url(array("controller" => "index", "action" => "index")) ?>>Personal Task</a>
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <div class="nav-collapse">
                        <?php if ($auth->hasIdentity()) : ?>
                            <ul class="nav">
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle"
                                       data-toggle="dropdown">
                                        Actividades
                                        <b class="caret"></b>
                                    </a>
                                    <ul class="dropdown-menu">
                                        <a href="<?= $this->url(array("controller" => "Activity", "action" => "index")) ?>">
                                            Ver Actividades
                                        </a>
                                        <a href="<?= $this->url(array("controller" => "Activity", "action" => "save")) ?>">
                                            Nueva Actividad
                                        </a>
                                    </ul>
                                </li>
                                <li class="dropdown">
                                    <a href="<?= $this->url(array("controller" => "Activity", "action" => "monitor")) ?>" class="dropdown-toggle"
                                       data-toggle="dropdown">
                                        Monitoreo
                                    </a>
                                </li>
                                <li class="dropdown">
                                    <a href="<?= $this->url(array("controller" => "AcercaDe", "action" => "index")) ?>" class="dropdown-toggle"
                                       data-toggle="dropdown">
                                        Acerca de
                                    </a>
                                </li>
                                <li class="dropdown">
                                     
                                    <a href="<?= $this->url(array("controller" => "Login", "action" => "logout")) ?>" class="dropdown-toggle"
                                       data-toggle="dropdown">
                                           Cerrar Sesi&oacute;n
                                    </a>
                                </li>
                            </ul>
                        
<!--                            <form class="navbar-search pull-left" action="<?= $this->url(array("controller" => "Activity", "action" => "search")) ?>" method="post">
                                <input type="text" class="search-query" placeholder="Buscar Actividades" name="query"/>
                            </form>-->
                            <form id="searchActivityForm" class="form-search pull-right"  action="<?= $this->url(array("controller" => "Activity", "action" => "search")) ?>" method="post">
                                <input id="activitiesSearch" type="text" class="input-medium search-query" placeholder="Buscar Actividades" name="query"/>
                                <button type="submit" class="btn">Buscar</button>
                            </form>
                        <?php else: ?>
                            <ul class="nav">
                                <li >
                                    <a href="<?= $this->url(array("controller" => "login", "action" => "register")) ?>">
                                        Registrar
                                    </a>
                                </li>
                            </ul>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>

        <div class="container">
            <?php echo $this->layout()->content ?>
        </div>        

<!--        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>-->
        <?php
        echo $this->headScript()->appendFile(
                $front->getBaseUrl() . '/bootstrap/js/bootstrap.min.js', 'text/javascript'
        );
        ?>
        
    </body>
</html>